package ltd.dujiabao.capability.adapter.driven.persistence.capmng;

import java.util.List;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import lombok.Data;
import ltd.dujiabao.capability.adapter.properties.LiveUpdateReminder;
import ltd.dujiabao.capability.domain.capmng.sync.Predicate;
import ltd.dujiabao.capability.domain.capmng.sync.Puller;
import ltd.dujiabao.capability.domain.capmng.sync.Transferor;
import ltd.dujiabao.capability.domain.devmng.DevType;

/**
 * @author : DuJiabao
 * @Project : ddd-capability
 * @Time : 2024/4/8 21:10
 * @Desc :
 */
@Data
@Configuration
@ConfigurationProperties(value = "capability")
@LiveUpdateReminder(events = CapabilityChangedEvent.class)
public class CapabilityProperties {
    private List<SynchronizerProperties> synchronizers;

    @Data
    public static class SynchronizerProperties {
        private String name;
        private List<DevType> devTypes;
        private List<WorkerProperties> workers;
    }

    @Data
    public static class WorkerProperties {
        private Class<? extends Predicate> predicate;
        private Class<? extends Puller> puller;
        private Class<? extends Transferor> transferor;
    }
}
